package exercise

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ExercisesRouter struct {
}

// InitExercisesRouter 初始化 exercise表 路由信息
func (s *ExercisesRouter) InitExercisesRouter(Router *gin.RouterGroup) {
	exercisesRouter := Router.Group("exercises").Use(middleware.OperationRecord())
	exercisesRouterWithoutRecord := Router.Group("exercises")

	var exercisesApi = v1.ApiGroupApp.ExerciseApiGroup.ExercisesApi
	{
		exercisesRouter.POST("createExercises", exercisesApi.CreateExercises)             // 新建exercise表
		exercisesRouter.DELETE("deleteExercises", exercisesApi.DeleteExercises)           // 删除exercise表
		exercisesRouter.DELETE("deleteExercisesByIds", exercisesApi.DeleteExercisesByIds) // 批量删除exercise表
		exercisesRouter.PUT("updateExercises", exercisesApi.UpdateExercises)              // 更新exercise表
	}
	{
		exercisesRouterWithoutRecord.GET("findExercises", exercisesApi.FindExercises)       // 根据ID获取exercise表
		exercisesRouterWithoutRecord.GET("getExercisesList", exercisesApi.GetExercisesList) // 获取exercise表列表
	}
}
